<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function phone(brand,price) {
        this.brand = brand
        this.price = price
    }
    //增加方法
    phone.prototype.call = function () {
        console.log('##')
    }
    //实例化
    let p = new phone('xiaomi',1000)
    p.call()
    console.log(p)


    //class
    class phone1{
        //构造方法 名称不能修改
        constructor(b,p){
            this.b = b
            this.p = p
        }
        call1(){
            console.log('$$')
        }
    }

    let one = new phone1('1',999)
    console.log(one)
</script>
</body>
</html>